<template>
  <div>
    <div class="table-default">
        <!-- {{ choseCode }}  -- {{ props.ids }} -->
      <el-table :data="tableData" class="mt-3" v-loading="loading">
        <el-table-column prop="pflcode" label="工艺流程代号" />
        <el-table-column prop="processname" label="工艺流程名称" />
        <el-table-column prop="description" label="描述" />
        <el-table-column label="操作">
          <template #default="scope">
            <el-button type="primary" @click="chose(scope.row)">选择</el-button>
          </template>
        </el-table-column>
      </el-table>
      <Paginate />
    </div>


  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';

export default defineComponent({
  name: 'processflow',
});
</script>

  
  <script lang="ts" setup>
import { computed, onMounted, defineEmits ,defineProps,ref} from 'vue'
import { useGetList } from '/admin/composables/curd/useGetList'
import { useDestroy } from '/admin/composables/curd/useDestroy'
import { useOpen } from '/admin/composables/curd/useOpen'

const getApi = 'promanagement/processflow'
const { data, query, search, reset, loading } = useGetList(getApi)
const { destroy, deleted } = useDestroy()
const { open, close, title, visible, id } = useOpen()

const props = defineProps({
primary: String ,
  ids: Array,
})


const tableData = computed(() => data.value?.data)

const choseCode = ref('')



const chose = data => {
    choseCode.value = data.pflcode
  emit('send-code', data)
}

let emit = defineEmits(['send-code'])

onMounted(() => {
  search()
  deleted(reset)
})
</script>
  